﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
using MethodWorx.Core.DomainModel;

namespace MethodWorx.CMS.Linq
{
    [Table(Name="dbo.GenericStorage")]
    public class LinqGenericStorage
    {
        private EntitySet<LinqGenericStorageIndex> indexes = new EntitySet<LinqGenericStorageIndex>();

        [Column(IsPrimaryKey=true, UpdateCheck=UpdateCheck.Never)]
        public Guid Id { get; set; }
        [Column(UpdateCheck=UpdateCheck.Never)]
        public string Type { get; set; }
        [Column(UpdateCheck = UpdateCheck.Never)]
        public string ObjectStorage { get; set; }

        [Association(Name="Indexes", IsForeignKey=true, ThisKey="Id", OtherKey="GenericStorageId", Storage="indexes")]
        public IList<LinqGenericStorageIndex> Indexes
        {
            get { return this.indexes; }
            set { this.indexes.Assign(value); }
        }
    }
}
